#ifndef _GL_LIGHT_MAP_H_
#define _GL_LIGHT_MAP_H_

#include "glFramebuffer.h"
#include "glTexture.h"
#include "glViewport.h"

class glLightMap
{
protected :
    CglFrameBuffer   m_fbo;

    uint32 m_color;
    uint32 m_depth;

    GL_VIEWPORT_DESC viewport;
    GL_TEXTURE_DESC  colorDesc,    depthDesc;
    GL_SAMPLER_DESC  colorSampler, depthSampler;

public:
    glLightMap(void);
    ~glLightMap(void);

    void Reshape(int width, int height, 
                 GLenum lightFormat = GL_RGBA16F, 
                 GLenum depthFormat = GL_DEPTH_COMPONENT24_ARB);

    void Release(void);

    void glBegin();
    void glEnd();

    uint32 getDepth() { return m_depth; }
    uint32 getColor() { return m_color; }
};

#endif